package com.zjw.kaos.common;

public class ResultUtils {
    public static <T> AjaxResult<T> sendSuccess(T data) {
        return new AjaxResult<>("200" , "成功" , data);
    }

    public static <T> AjaxResult<T> sendSuccess(String message , T data ) {
        return new AjaxResult<>("200" , message , data);
    }

    public static <T> AjaxResult<T> sendSuccess(String message) {
        return new AjaxResult<>("200" , message , null);
    }

    public static <T> AjaxResult<T> sendSuccess(String code , String message){
        return new AjaxResult<>(code , message , null);
    }

    public static <T> AjaxResult<T> sendSuccess(String code , String message , T data){
        return new AjaxResult<>(code , message , data);
    }


    public static <T> AjaxResult<T> sendError(String code , String message) {
        return new AjaxResult<>(code , message , null);
    }


    public static <T> AjaxResult<T> sendError(String message) {
        return new AjaxResult<>("500" , message , null);
    }


    public static <T> AjaxResult<T> sendError(T data) {
        return new AjaxResult<>("500" , "失败" , data);
    }


    public static <T> AjaxResult<T> sendError(T data , String message) {
        return new AjaxResult<>("500" , message , data);
    }
}
